<!DOCTYPE html>
<html style="height: 100%">
   <head>
       <meta charset="utf-8">
   </head>
   <body style="height: 100%; margin: 0">
       <div id="container" style="height: 100%"></div>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts.min.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts-gl/echarts-gl.min.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts-stat/ecStat.min.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/dataTool.min.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/map/js/china.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/map/js/world.js"></script>
       <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ZUONbpqGBsYGXNIYHicvbAbM"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/bmap.min.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/simplex.js"></script>
       <script type="text/javascript">
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};
option = null;
option = {
    title : {
        text: '某站点用户访问来源',
        subtext: '纯属虚构',
        x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        left: 'left',
        data: ['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
    },
    
    series : [
        {
            startAngle: 130,
            hoverOffset: 4,
            name: '访问来源',
            type: 'pie',
            radius : '55%',
            center: ['50%', '60%'],
            label: {
              show: true,
              position: 'inside',
              color: '#333',
              align: 'right',
            //   padding: [0,0,30,40],
              formatter: function(params){
                if(params.data.name.length> 4){
                    var labelNewText = params.data.name.substring(0,2)+' ...';
                }
                return labelNewText;
                }
            },
            labelLine: {
                show: false,
                smooth: true,
                lineStyle: {
                    color: 'red'
                }
            },
            data:[
                {isnext: 1, dvalue: 66, name: "华东大区", value: 1393},
                {isnext: 1, dvalue: 2, name: "西北大区", value: 1148},
                {isnext: 1, dvalue: 23, name: "南方大区", value: 910,
                    label: {
                      position: 'outside',
                    },
                    labelLine: {
                        show: true,
                        length: 16,
                        length2: 6,
                        emphasis: {
                            show: true
                        }
                    }
                },
                {isnext: 1, dvalue: 1, name: "东南大区", value: 833,
                    label: {
                      position: 'outside',
                    },
                    labelLine: {
                        show: true,
                        length: 16,
                        length2: 16,
                        emphasis: {
                            show: true
                        }
                    }
                },
                {isnext: 1, dvalue: 22, name: "北方大区", value: 448,
                    label: {
                      position: 'outside',
                    },
                    labelLine: {
                        show: true,
                        length: 16,
                        length2: 6,
                        emphasis: {
                            show: true
                        }
                    }
                },
                {isnext: 1, dvalue: 64, name: "西方大区", value: 448,
                    label: {
                      position: 'outside',
                    },
                    labelLine: {
                        show: true,
                        length: 16,
                        length2: 6,
                        emphasis: {
                            show: true
                        }
                    }
                },
                {isnext: 1, dvalue: 65, name: "东北大区", value: 231,
                    label: {
                      position: 'outside',
                    },
                    labelLine: {
                        show: true,
                        length: 16,
                        length2: 6,
                        emphasis: {
                            show: true
                        }
                    }
                    
                }
            ],
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
};;
if (option && typeof option === "object") {
    myChart.setOption(option, true);
}
       </script>
   </body>
</html>